package com.liangwj.springbootdesignpatterns.structureTypePatterns.bridge.demo_2;

import com.liangwj.springbootdesignpatterns.structureTypePatterns.bridge.demo_2.car.AbstractCar;
import com.liangwj.springbootdesignpatterns.structureTypePatterns.bridge.demo_2.car.BMWCar;
import com.liangwj.springbootdesignpatterns.structureTypePatterns.bridge.demo_2.car.BenzCar;
import com.liangwj.springbootdesignpatterns.structureTypePatterns.bridge.demo_2.transmission.Auto;
import com.liangwj.springbootdesignpatterns.structureTypePatterns.bridge.demo_2.transmission.Manual;

/**
 * <b>Description:</b>  <br/>
 * 有了变速器和品牌两个维度各自的实现后，可以通过聚合，实现不同品牌不同变速器的车
 * @author Lingwenjun
 * @date 2019/1/23-17:53
 * @version 1.0
 */
public class BridgeDemoTest {

    public static void main(String[] args) {
        AbstractCar car = new BMWCar();
        car.setTransmission(new Manual());//可以用构造方法改造
        car.run();

        car = new BenzCar();
        car.setTransmission(new Auto());
        car.run();
    }
}
